<!DOCTYPE HTML>
<html>
  <head>
    <link rel="stylesheet" type="text/css" href="styles/selectable.css">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>jQuery UI Selectable Example 4</title>
  </head>
  <body>
    <div id="selectables">
      <div id="selectabl1" class="selectable">This div can be selected</div>
      <div id="selectabl2" class="selectable">This div can be selected</div>
      <div id="selectabl3" class="selectable">This div can be selected</div>
      <div id="selectabl4" class="selectable">This div can be selected</div>
      <div id="selectabl5" class="selectable">This div can be selected</div>
      <div id="selectabl6" class="selectable">This div can be selected</div>
    </div>
    
    <script type="text/javascript" src="js/jquery.js"></script>
    <script type="text/javascript" src="js/jquery-ui.js"></script>
    <script type="text/javascript">
			$(function() {
			
				//define config object
				var selectableObj = {
					selected: function(e, ui) {
						$("#" + ui.selected.id).text("I have been selected!");
					},
					unselected: function(e, ui) {
						$("#" + ui.unselected.id).text("This div can be selected");
					},
					start: function(e) {
						$("<div>").attr("id", "tip").text("Drag the lasso around elements, or click to select").css({
							position:"absolute",
							backgroundColor:"#ffffcc",
							border:"1px solid #3366ff",
							width:"310px",
							height:"20px",
							textAlign:"center",
							left:e.pageX,
							top:e.pageY - 30
						}).appendTo($("body"));
					},
					stop: function() {
						$("#tip").fadeOut();  
					}
				}

				$("#selectables").selectable(selectableObj);
			});
		</script>
  </body>
</html>
